﻿<%@ Page Language="C#" MasterPageFile="~/Masterpage.Master" AutoEventWireup="true" CodeBehind="CampaignsList.aspx.cs" Inherits="EmailMarketingCampaign.CampaignsList" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link rel="stylesheet" type="text/css" href="~/css/style.css" />
<%--<script type="text/javascript">
    
     function SetCheckBoxState()
     {
     var dom=document.all;
     var el=event.srcElement;
     
     if(el.tagName=="INPUT"&&el.type.toLowerCase()=="checkbox")
     {
        for(i=0;i<dom.length;i++)
        {
            if(dom[i].tagName=="INPUT"&&dom[i].type.toLowerCase()=="checkbox")
            {
                dom[i].checked=false;
            }
        }
     }
        el.checked=!el.checked;
     }
  </script>--%>
  
  
  <script language="javascript" type="text/javascript">


function ckOnClick(e)
{
    var ck = document.getElementsByName("select")
    var Id="";
    for(var i = 0; i < ck.length; i++)
    {
        if(ck[i].checked) Id = ck[i].Id;
    }
    for(var i = 0; i < ck.length; i++)
    {
        ck[i].checked = false;
    }
    if (e.Id==Id)
        e.checked = true;
    else
        e.checked = false;
    for(var i = 0; i < ck.length; i++)
    {
        if(ck[i].checked==true)
        {
            for(var j = 0; j < ck.length; j++)
            {
                if(j!=i)
                {
                    ck[j].checked = false; 
                }
            }
        }
    }
}
</script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <div class="content">
<div id="post-69" class="post">
 <span class="absolute box_2_t_l"></span> 
 <span class="absolute box_2_t_r"></span> 
 <span class="absolute box_2_b_l"></span>
  <span class="absolute box_2_b_r"></span>


<p class="a">Campaign List</p>
 <div class="details">
  
  <table >
            <tr>
                <td align="center"  >
     <asp:Label ID="Label1" runat="server"></asp:Label>
        <asp:GridView ID="GridView1" runat="server" Height="188px" Width="516px" 
            AutoGenerateColumns="False" DataSourceID="dsMySQL" AllowPaging="True" 
            AllowSorting="True" DataKeyNames="CampaignID" 
                        BorderColor="#EBEBEB" onrowcommand="GridView1_RowCommand" 
                        onrowcreated="GridView1_RowCreated">
            <Columns>
                <asp:BoundField DataField="ThemeName" HeaderText="ThemeName" />
                <asp:BoundField DataField="CampaignName" HeaderText="CampaignName" />
                <asp:BoundField DataField="Description" HeaderText="Description" />
                <asp:TemplateField HeaderText="Schedule">
                    <ItemTemplate>
                        <asp:TextBox ID="txtSchedule" runat="server" Height="30px" TextMode="MultiLine"   style="overflow-y: scroll"
                            Width="154px"></asp:TextBox>
                    </ItemTemplate>
                </asp:TemplateField>
                
                    <asp:TemplateField HeaderText="Schedule">
                        <ItemTemplate>
                            <asp:Button ID="btnSchedule" CommandName="schedule"  CssClass="button" runat="server" Text="No Record" Enabled="False"   />
                        </ItemTemplate>
                        <ControlStyle Width="81px" />
                    </asp:TemplateField>
                <asp:TemplateField>
                    <ItemTemplate>
                  <asp:CheckBox ID="select" runat="server" onclick='SetCheckBoxState()'/>
                      <%-- <input id="select" type="checkbox" onclick=" ckOnClick(this)" />--%>
                    </ItemTemplate>
                </asp:TemplateField>
                
            </Columns>
            <PagerStyle HorizontalAlign="Center"  />
                <HeaderStyle BackColor="#67A897" ForeColor="White"  Height ="30" HorizontalAlign="Center" />
                         
                            
            <EditRowStyle BorderColor="#EBEBEB" />
                         
                            
        </asp:GridView>
    
                </td>
                <td>
        
                    <asp:Panel ID="Panel1" runat="server" Height="151px" Visible="False" 
                        Width="154px">
                        <asp:TextBox ID="TextBox1" runat="server" TextMode="MultiLine" 
                            Width="154px"></asp:TextBox>
                    </asp:Panel>
        
                </td>
            </tr>
    </table>





    
    <asp:Button ID="btnAddCampaign" runat="server" CssClass="button" Text="Add new Campaign " 
        onclick="btnAddCampaign_Click" Width="133px" Height="27px" />
    <asp:Button ID="btnEditCampaign" runat="server" CssClass="button" onclick="btnEditCampaign_Click" 
        Text="Edit" Width="71px" Height="27px" />
    
     
     
     <br />
  </div>
 </div>
 </div>
 
 

    <br />
 
 

   
<asp:SqlDataSource ID="dsMySQL" runat="server" ConnectionString="<%$ ConnectionStrings:EmailMarketing_DBConnectionString%>" ProviderName="<%$ ConnectionStrings:EmailMarketing_DBConnectionString.ProviderName %>"
    SelectCommand="select c.CampaignID,c.themeID,ca.ThemeName,c.CampaignName,c.Description,c.Schedule from campaigns c
inner join campaigntheme ca on ca.ThemeID=c.ThemeID where c.COMUniquelID =?COMUniquelID order by c.CampaignID">
       <SelectParameters> <asp:SessionParameter Name="COMUniquelID"  SessionField="COMUniquelID"  Type="String" />   </SelectParameters>
</asp:SqlDataSource>
    
        
    
  
   

</asp:Content>
